from langchain.llms.openai import OpenAI
from langchain.agents import load_tools,initialize_agent,AgentType
import os
from llama_index.core import Settings
from llama_index.llms.ollama import Ollama

llm = Ollama(model='qwen:1.8b')
Settings.llm = llm


os.environ['OPENAI_API_KEY'] = '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'
#
llm = OpenAI(temperature=0.,model='text-davinci-003')

agent = initialize_agent(
    tools=load_tools(['python_repl']),llm=llm,agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,verbose=True
)
agent.run("what's 4+ 4")